<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['middleware' => ['web']], function () {
    Route::group(['prefix'=>'admin'],function(){
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        Route::get('user-list',['as' => 'Admin.Home.userList', 'uses' => 'AdminController@userList']);
        Route::get('vip-list',['as' => 'Admin.Home.vipList', 'uses' => 'AdminController@vipList']);
        Route::get('user-set',['as' => 'Admin.Home.userSet', 'uses' => 'AdminController@userSet']);
        Route::get('change-Pwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        Route::get('admin-list',['as' => 'Admin.Home.adminList' , 'uses' => 'AdminController@adminList']);
        Route::get('admin-set',['as' => 'Admin.Home.adminSet' , 'uses' => 'AdminController@adminSet']);
        Route::get('orderList',['as' => 'Admin.Home.orderList' , 'uses' => 'AdminController@orderList']);
        Route::get('dataShow',['as' => 'Admin.Home.dataShow' , 'uses' => 'AdminController@dataShow']);
    });
});

Route::group(['prefix'=>'api', 'namespace'=>'Api','middleware' => ['cors']],function(){
    Route::group(['prefix' => 'user'],function() {
        Route::post('userSurvey',['as'=>'Api.User.userSurvey','uses'=>'UserController@userSurvey']);
    });

     Route::group(['prefix' => 'ali'],function() {
         Route::post('getOrderData',['as'=>'Api.Ali.getOrderData','uses'=>'AlidataController@getOrderData']);
         Route::any('getAccessToken',['as'=>'Api.Ali.getAccessToken','uses'=>'AlidataController@getAccessToken']);
         Route::get('toAuth',['as'=>'Api.Ali.toAuth','uses'=>'AlidataController@toAuth']);
         Route::get('autoSynchOrder',['as'=>'Api.Ali.autoSynchOrder','uses'=>'AlidataController@autoSynchOrder']);
         Route::get('getSychMsg',['as'=>'Api.Ali.getSychMsg','uses'=>'AlidataController@getSychMsg']);
     });

    Route::group(['prefix' => 'file'],function(){
        Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
        Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
        Route::post('uploadBase64Image',['as'=>'Api.File.uploadBase64Image','uses'=>'ImageController@uploadBase64Image']);
        Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        Route::post('uploadVideo',['as'=>'Api.File.uploadVideo','uses'=>'ImageController@uploadVideo']);
        Route::get('show-image-oss/{id}',['as'=>'Api.File.showImageByOssId','uses'=>'ImageController@showImageByOssId']);
    });

    Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
        Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
        Route::post('auth/change-pwd',['as'=>'Api.AdmiHome.Small.contentn.Auth.changePassword','uses'=>'AuthController@changePassword']);
        Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
        Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
        Route::post('sys/setAdmin',['as' => 'Api.Admin.sys.setAdmin','uses' => 'SystemController@setAdmin']);
        Route::post('sys/setUser',['as' => 'Api.Admin.sys.setUser','uses' => 'SystemController@setUser']);
        Route::post('sys/delUser',['as' => 'Api.Admin.sys.delUser','uses' => 'SystemController@delUser']);
        Route::post('sys/delAdmin',['as'=>'Api.Admin.sys.delAdmin','uses'=>'SystemController@delAdmin']);
        Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
        Route::post('sys/changeNewsShow',['as'=>'Api.Admin.sys.changeNewsShow','uses'=>'SystemController@changeNewsShow']);
    });
});
